/*
 * @Author: 137 '1432417996@qq.com'
 * @Date: 2025-04-29 22:01:49
 * @LastEditors: 137 '1432417996@qq.com'
 * @LastEditTime: 2025-04-29 22:48:41
 * @FilePath: \starter-3\api\calendar.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { request } from '@/api/request'
// 获取月度日历事件
export function getMonthCalendar(data) {
  return request({
    url: '/calendar/month',
    method: 'post',
    data
  })
}

// 添加日历事件
export function addCalendarEvent(data) {
  return request({
    url: '/calendar/events',
    method: 'post',
    data
  })
}

// 更新日历事件
export function updateCalendarEvent(eventId, data) {
  return request({
    url: `/calendar/events/${eventId}`,
    method: 'put',
    data
  })
}

// 删除日历事件
export function deleteEvent(eventId) {
  return request({
    url: `/calendar/events/${eventId}`,
    method: 'delete'
  })
}

// 获取日历事件详情
export function getEventDetail(eventId) {
  return request({
    url: `/calendar/events/${eventId}`,
    method: 'get'
  })
}

// 获取最近重大事件
export function getRecentEvents() {
  return request({
    url: '/calendar/recent-events',
    method: 'get',
  })
}
